package com.study;

import java.io.*;

public class TestDemo01 {
    public static void main(String[] args) throws UnsupportedEncodingException {

        /*try (FileInputStream fis = new FileInputStream("d:/log.txt")) {
            int i = 0;
            byte[] bytes = new byte[1024];
            while ((i = fis.read(bytes)) != -1){
                System.out.print(new String(bytes,0,i));
            }
        } catch (Exception e) {

        }*/

        try(BufferedInputStream bis = new BufferedInputStream(new FileInputStream("d:/log.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:/log_cp.txt"))){
            int i = 0;
            byte[] bytes = new byte[1024];
            while ((i = bis.read(bytes)) != -1){
                bos.write(bytes,0,i);
            }
        }catch (Exception e){

        }
    }
}
